package com.offcn.controller;

import com.offcn.feign.ProviderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {

    @Autowired
    private ProviderFeign providerFeign;

    @GetMapping("/hi")
    public String hi() {

        try {
            Thread.sleep( 1000 );
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(System.currentTimeMillis());
        return providerFeign.hello()+"hi";
    }



    @GetMapping("/hi2")
    public String hi2() throws InterruptedException {
        Thread.sleep( 1000 );
        System.out.println(System.currentTimeMillis());
        return providerFeign.hello()+"hi2";
    }
}
